#ifndef _LIST
#define _LIST

template <typename T>
class List
{
  T *stack;            // the actual item stack

  ulong occupiedItems, // amount of items in the list at the moment
        maxItems;      // max amount of items that can be added before Resize() happens

  // reallocate memory to contain newSize items (min: occupiedItems)
  void Resize(ulong newSize);

public:
  // con-/destructor
  List();
  ~List();

  // basic access ----------------------------------------------------------------------------------
  bool Add(T _item);         // add item X
  bool Del(T _item);         // delete item X

  ulong Size();              // -> occupiedItems
  T Operator[](ulong index); // access item X

  // sort functionality ----------------------------------------------------------------------------
  int *(ItemCompare)(T a, T b); // function pointer for returning a comparison value
  void Sort(ItemCompare f);     // sort list by comparing item A,B

#ifdef DEBUG
  void Print(); // print contents
#endif
}

#endif // _LIST
